#!/usr/bin/env sh

installDep() {
    curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
    sudo apt-get install -y nodejs
    sudo apt-get install -y git
    npm i -g pm2
    npm i -g yarn
}

installAgent(){
    cd /opt
    git clone https://gitee.com/liulinhui1994/swarm-agent.git
    cd swarm-agent
    yarn install
    pm2 start index.js
}

installDep
installAgent
